import os
import unittest
from cases.Base_Case import BASECASE
from config.config import DATA_PATH
from page.index import IndexPage
from page.门诊护士站.门诊护士站.menzhenhushizhan__page import menzhenhushizhan
from tools.sjqd_way import read_data_from_excel

class TestMenzhenhushizhan(BASECASE):
    @classmethod
    def setUpClass(cls):
        ap = IndexPage()
        ap.jrym_no1('门诊护士站')
    @classmethod
    def tearDownClass(cls):
        ap = IndexPage()
        ap.close_all_xxk()
        print("{}执行完毕-------------------------------------------------".format(cls))
    def test_1_menzhenhushizhan_shuyedan(self):
        self.data = read_data_from_excel(os.path.join(DATA_PATH, "datas.xls"), "测试患者")
        name = self.data[0][0]
        bp = menzhenhushizhan()
        bp.input_xm(name)
        bp.click_wzx_btn()#点击未执行
        bp.click_qbks_btn()#点击全部科室
        bp.click_syd_xxk()#点击输液单选项卡
        bp.click_cx_btn()#点击查询按钮
        bp.click_hzsj1()#点击患者
        bp.click_qxbt_btn()  # 点击全选标头
        bp.click_zx_btn()  # 点击执行按钮
    @unittest.skip
    def test_2_menzhenhushizhan_zhushedan(self):
        bp = menzhenhushizhan()
        bp.click_zsd_xxk()  #点击注射单选项卡
        bp.click_cx_btn()  # 点击查询按钮
        bp.huanzheshuju1.Refind()
        bp.click_hzsj1()  # 点击患者
        bp.quanxuanbiaotou.Refind()
        bp.click_qxbt_btn()  #点击全选标头
        bp.click_zx_btn()  # 点击执行按钮
    def test_3_menzhenhushizhan_shimin(self):
        bp = menzhenhushizhan()
        bp.click_sm_xxk()  # 点击试敏选项卡
        bp.click_cx_btn()  # 点击查询按钮
        bp.huanzheshuju1.Refind()
        bp.click_hzsj1()  # 点击患者
        bp.click_sj1_btn()#点击数据1标头
        bp.click_zx_btn()  # 点击执行按钮
        bp.click_smqd_btn()#试敏确定
    def test_4_menzhenhushizhan_xiugaishimin(self):
        bp = menzhenhushizhan()
        bp.click_yzx_btn()#点击已执行按钮
        bp.click_sm_xxk()  # 点击试敏选项卡
        bp.click_cx_btn()#点击查询按钮
        bp.yaopinshuju1.Refind()
        bp.shuju1biaotou.Refind()
        bp.click_sj1_btn()  # 点击数据1标头
        bp.click_smxg_btn()#点击试敏修按钮
        bp.click_smjg1()  # 点击试敏结果1
        bp.click_xgsmqd_btn()#点击修改试敏结果确定按钮
if __name__ == '__main__':
    unittest.main()

